import {ADD_PERSON} from '../constant'

const initState = []
export default function personReducer(preState = initState, action) {
    const {type, data} = action
    // 根据Type决定如何加工数据
    switch (type) {
        case ADD_PERSON:
            return [data, ...preState]

        default:
            return preState
    }
}
